class DadoPessoal < ActiveRecord::Base
  belongs_to :funcionario

  validates :nome, :presence => true, :format => { :with => /\A[a-zA-Z]+\z/ } #, :format => { :with => /^[\D]+$/ }
  validates :cpf, :presence => true, :uniqueness => true, :length => { :is => 11 }, :numericality => true
  validates :email, :presence => true, :uniqueness => true, :format => { :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/ }
  
  validates_associated :funcionario
end
